/**
 * 
 */
package org.dragonfire.editor.syntax.rules;

import java.util.ArrayList;

import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;

/**
 * @author Darth Android
 * @date Dec 27, 2007
 */
public class ColumnKeywordRule extends KeywordRule {

	private int column = 0;

	/**
	 * @param keywords
	 */
	public ColumnKeywordRule(ArrayList<String> keywords, int beginColumn) {
		super(keywords);
		column = beginColumn;
	}

	public ColumnKeywordRule(ArrayList<String> keywords, int beginColumn, String attributeName) {
		super(keywords, attributeName);
		column = beginColumn;
	}

	/**
	 * @param keywords
	 */
	public ColumnKeywordRule(String[] keywords, int beginColumn) {
		super(keywords);
		column = beginColumn;
	}

	public IToken evaluate(org.eclipse.jface.text.rules.ICharacterScanner scanner) {
		if (scanner.getColumn() != column)
			return Token.UNDEFINED;
		return super.evaluate(scanner);
	}
}
